#include "OgreGLESPlugin.h"
#include "OgreRoot.h"

namespace Ogre
{
	static const String sPluginName = "OpenGL ES 1.x Render System";

	GLESPlugin::GLESPlugin()
		: mRenderSystem(0)
	{
	}

	const String& GLESPlugin::getName() const
	{
		return sPluginName;
	}

	void GLESPlugin::install()
	{
		mRenderSystem = new GLESRenderSystem();

		Root::getSingleton().addRenderSystem(mRenderSystem);
#if OGRE_PLATFORM == OGRE_PLATFORM_IPHONE
        Root::getSingleton().setRenderSystem(mRenderSystem);
#endif
	}

	void GLESPlugin::initialise()
    {
        // nothing to do
    }

	void GLESPlugin::shutdown()
    {
        // nothing to do
    }

	void GLESPlugin::uninstall()
	{
		delete mRenderSystem;
		mRenderSystem = 0;
	}
}
